package com.robert.custombehavior

import android.os.Bundle
import android.support.design.widget.TabLayout
import android.support.v4.view.ViewPager
import android.support.v7.app.AppCompatActivity
import android.widget.LinearLayout
import com.robert.custombehavior.adpatper.MyVpAdapter


class MainActivity : AppCompatActivity() {
    private lateinit var mTab: TabLayout
    private lateinit var mHeader: LinearLayout
    private lateinit var mVp: ViewPager

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        mTab = findViewById(R.id.tab);
        mHeader = findViewById(R.id.header);
        mVp = findViewById(R.id.vp);
        mVp.setAdapter(MyVpAdapter(this));
        mTab.setupWithViewPager(mVp);
    }
}
